package cn.xinfei.xdecision.common.service.component.scorecard.impl;

import cn.xinfei.xdecision.common.dao.component.scorecard.ScorecardDetailMapper;
import cn.xinfei.xdecision.common.model.component.scorecard.ScorecardDetail;
import cn.xinfei.xdecision.common.service.component.scorecard.ScorecardDetailService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 评分卡明细表(ScorecardDetail)表服务实现类
 */
@Service
public class ScorecardDetailServiceImpl extends ServiceImpl<ScorecardDetailMapper, ScorecardDetail> implements ScorecardDetailService {


    @Override
    public List<ScorecardDetail> getDetailListByDimensionId(Integer dimensionId) {

        LambdaQueryWrapper<ScorecardDetail> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ScorecardDetail::getDimensionId, dimensionId);
        List<ScorecardDetail> scorecardDetails = this.list(queryWrapper);
        return scorecardDetails;
    }

    @Override
    public List<ScorecardDetail> getDetailListByDimensionIds(List<Integer> dimensionIds) {

        LambdaQueryWrapper<ScorecardDetail> detailLambdaQueryWrapper = new LambdaQueryWrapper<>();
        detailLambdaQueryWrapper.in(ScorecardDetail::getDimensionId, dimensionIds);
        List<ScorecardDetail> scorecardDetails = this.list(detailLambdaQueryWrapper);
        return scorecardDetails;
    }
}
